import {
	mapMutations
} from 'vuex'
export default {
	...mapMutations([
		'upUserInfo'
	]),
	submitForm() {
		let that = this
		if (that.atLoading) {
			//禁止多次点击
			return false
		}
		that.atLoading = true
		that.$httpRequest.request({
			that: that,
			url: 'wechat/editUserInfo',
			params: {
				nickname: that.userInfo.nickname
			},
			success: res => {
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					that.upUserInfo(that.userInfo)
					uni.navigateBack({
						delta: 1
					})
				}
			}
		})
		setTimeout(() => { //延时指定时间后，再解冻
			that.atLoading = false;
		}, 1000);
	}
}